#include "stm32f10x.h"                  // Device header
#include "LED.h"
#include "Delay.h"
#include "Key.h"

int main(void){
    uint8_t val = 0;
    uint8_t old_val = 0;
    uint8_t status[4] = {0};
    LED_Init();
    Key_Init();
    while(1){
        val = Get_Key();
        if(old_val != val){
            status[val-1] += 1;
            status[val-1] %= 2;
            LED_Set(val-1,status[val-1]);
        }
        old_val = val;
    }
}
